package com.cloud.test.userprovider.controller;

import com.cloud.test.userprovider.dao.UserDao;
import com.cloud.test.userprovider.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


/**
 * @author HanLiBin
 * @version V1.0
 */
@RestController
public class UserController {
    @Autowired
    private UserDao userDao;

    @GetMapping("/simple/{id}")
    public User findOneById(@PathVariable Integer id) {
        return userDao.findOne(id);
    }

    @PostMapping("/user")
    public User saveUser(@RequestBody User user){
        return user;
    }
}
